import request from '@/utils/request'

// 登录方法
export function login(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/login',
    method: 'post',
    data: data
  })
}
//获取登入页面的标题
export function loginTitle(data) {
  return request({
    url: '/hisTitle/loginTitle',
    method: 'get',
    params: data
  })
}
//获取注册页面的标题
export function registerTitle(data) {
  return request({
    url: '/hisTitle/registerTitle',
    method: 'get',
    params: data
  })
}


// 医院注册的请求
export function register(data) {
  return request({
    url: '/his/register/registerHospital',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 医院注册的请求
export function registerHos(data) {
  return request({
    url: '/his/allHos/registerHospital',
    // headers: {
    //   isToken: false
    // },
    method: 'post',
    data: data
  })
}

// 医生注册的请求
export function registerDoctor(data) {
  return request({
    url: '/his/allDoc/registerDoctor',
    // headers: {
    //   isToken: false
    // },
    method: 'post',
    data: data
  })
}
// 医生注册的请求
export function registerNurse(data) {
  return request({
    url: '/his/nurse/registerNurse',
    method: 'post',
    data: data
  })
}

export function getHosListBySig(data) {
  return request({
    url: '/his/allHos/getHosListBySig',
    method: 'get',
    params: data
  });
}
export function getDocListBySig(data) {
  return request({
    url: '/his/allDoc/getDocListBySig',
    method: 'get',
    params: data
  });
}

export function getNurListBySig(data) {
  return request({
    url: '/his/nurse/getNurListBySig',
    method: 'get',
    params: data
  });
}
// 获取用户详细信息
export function getRegionList() {
  return request({
    url: '/his/register/getRegionList',
    method: 'get',
  })
}
// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'get',
    timeout: 20000
  })
}

export function checkHosSameName(data) {
  return request({
    url: '/his/allHos/checkSameName',
    method: 'get',
    params: data
  });
}

export function checkDocSameName(data) {
  return request({
    url: '/his/allDoc/checkSameName',
    method: 'get',
    params: data
  });
}

export function checkNurSameName(data) {
  return request({
    url: '/his/nurse/checkSameName',
    method: 'get',
    params: data
  });
}
